import { createRouter, createWebHistory } from "vue-router";
const routes = [
  {
    path: '',
    redirect: '首页'
  },
  {
    path: '/首页',
    component: () => import('@/views/home/home.vue'),
  },
  {
    path: '/要闻',
    component: () => import('@/views/news/news.vue'),
  },
  {
    path: '/detial/:id',
    component: () => import('@/views/detial/detial.vue'),
  }
]
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes
});
router.afterEach((to, from, next) => {
  window, scrollTo(0, 0)
})


export default router;